home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Newton Sample Code 1.2 / User Interface Guidelines / AdjustoButton-1 / AdjustoButton.text < prev    next >
Encoding:
Text File  |  1994-07-07  |  6.4 KB  |  293 lines  |  [TEXT/MPS ]

  1.  
  2. // ---- End Project Data ----
  3.  
  4.  
  5. // ---- File AdjustoButton.t ----
  6.  
  7. // ---- File protoResizeApp ----
  8.  
  9. // Before Script for "_userproto000"
  10. // Copyright, © 1994 Apple Computer. All rights reserved.
  11.  
  12. _userproto000 :=
  13.    {maxAppWidth: 240,
  14.     maxAppHeight: 336,
  15.     viewSetupFormScript:
  16.       func()
  17.       begin
  18.           local l := getAppParams();
  19.           viewBounds := RelBounds(l.appAreaLeft, l.appAreaTop,
  20.               MIN(l.appAreaWidth, maxAppWidth),
  21.               MIN(l.appAreaHeight, maxAppHeight)) ;
  22.       end,
  23.     _proto: protoApp
  24.    };
  25.  
  26.  
  27. // ---- Back in File AdjustoButton.t ----
  28.  
  29. // Before Script for "_view000"
  30. // Copyright © 1994 Apple Computer, Inc. All rights reserved.
  31.  
  32. _view000 :=
  33.    {viewBounds: {top: 0, left: 0, right: 240, bottom: 336},
  34.     title: "Adjusto Buttons",
  35.     _proto: _userproto000
  36.    };
  37.  
  38. Adjusto1 := /* child of _view000 */
  39.    {viewFlags: 1,
  40.     viewFormat: 336,
  41.     viewBounds: {left: 4, top: 32, right: 235, bottom: 127},
  42.     viewclass: 74,
  43.     debug: "Adjusto1"
  44.    };
  45.  
  46.  
  47. // Before Script for "theText"
  48. // Copyright, © 1994 Apple Computer. All rights reserved.
  49.  
  50. theText := /* child of Adjusto1 */
  51.    {viewBounds: {left: 2, top: 10, right: 229, bottom: 33},
  52.     label: "Button String:",
  53.     labelCommands:
  54.       ["OK", "Cancel", "Only Three Words", "Suggestive Action Title"],
  55.     text: "Some Initial Value",
  56.     _proto: protoLabelInputLine,
  57.     debug: "theText"
  58.    };
  59. // View theText is declared to Adjusto1
  60.  
  61.  
  62.  
  63.  
  64. // ---- File protoAdjustoButton ----
  65.  
  66. // Before Script for "_userproto001"
  67. // Copyright, © 1994 Apple Computer. All rights reserved.
  68.  
  69. _userproto001 :=
  70.    {buttonHeight: 13,
  71.     textSpacer: 8,
  72.     viewSetupFormScript:
  73.       func()
  74.       begin
  75.           viewBounds := RelBounds(viewBounds.left, viewBounds.top,
  76.                    StrFontWidth(text, viewFont) + textSpacer, buttonHeight) ;
  77.       end,
  78.     viewChangedScript:
  79.       func(slot, view)
  80.       begin
  81.           inherited:?viewChangedScript(slot, view) ;
  82.           if slot = 'text then
  83.               :SyncView();            // SyncView causes the viewSetupFormScript to be called again,
  84.                                           // which sets the size based on the text.
  85.       end,
  86.     _proto: protoTextButton
  87.    };
  88.  
  89.  
  90. // ---- Back in File AdjustoButton.t ----
  91. theButton := /* child of Adjusto1 */
  92.    {viewBounds: {left: 7, top: 71, right: 75, bottom: 83},
  93.     text: "AdjustoButton",
  94.     _proto: _userproto001,
  95.     debug: "theButton"
  96.    };
  97. // View theButton is declared to Adjusto1
  98.  
  99.  
  100.  
  101. _view001 := /* child of Adjusto1 */
  102.    {viewBounds: {left: 68, top: 40, right: 148, bottom: 52},
  103.     text: "Update Button Text",
  104.     buttonClickScript:
  105.       func()
  106.       begin
  107.           SetValue(theButton, 'text, theText.entryLine.text) ;
  108.       end,
  109.     _proto: _userproto001
  110.    };
  111.  
  112.  
  113.  
  114.  
  115.  
  116. _view002 := /* child of _view000 */
  117.    {text: "Single Adjusto",
  118.     viewBounds: {left: 12, top: 26, right: 88, bottom: 36},
  119.     viewFormat: 1,
  120.     viewJustify: 8388614,
  121.     _proto: protoStaticText
  122.    };
  123.  
  124.  
  125.  
  126. Adjusto2 := /* child of _view000 */
  127.    {viewFlags: 1,
  128.     viewFormat: 336,
  129.     viewBounds: {left: 5, top: 141, right: 235, bottom: 303},
  130.     viewclass: 74,
  131.     debug: "Adjusto2"
  132.    };
  133.  
  134. _view003 := /* child of Adjusto2 */
  135.    {viewFlags: 33,
  136.     viewFormat: nil,
  137.     viewBounds: {left: 0, top: 143, right: 232, bottom: 163},
  138.     viewclass: 74
  139.    };
  140.  
  141.  
  142. // ---- File protoAdjustoClusterButton ----
  143. _userproto002 :=
  144.    {viewBounds: {left: 8, top: 2, right: 0, bottom: 0},
  145.     viewJustify: 8389638,
  146.     viewChangedScript:
  147.       func(slot, view)
  148.       begin
  149.           inherited:?viewChangedScript(slot, view) ;
  150.           if slot = 'text then
  151.               begin
  152.                   :Parent():SyncChildren();
  153.                   :Parent():Dirty();
  154.               end
  155.       end,
  156.     _proto: _userproto001
  157.    };
  158.  
  159.  
  160. // ---- Back in File AdjustoButton.t ----
  161. Button1 := /* child of _view003 */
  162.    {text: "Button 1",
  163.     viewBounds: {left: 4, top: 2, right: 0, bottom: 0},
  164.     _proto: _userproto002,
  165.     debug: "Button1"
  166.    };
  167. // View Button1 is declared to Adjusto2
  168.  
  169.  
  170.  
  171. Button2 := /* child of _view003 */
  172.    {text: "Button 2", _proto: _userproto002, debug: "Button2"};
  173. // View Button2 is declared to Adjusto2
  174.  
  175.  
  176.  
  177. Button3 := /* child of _view003 */
  178.    {text: "Button 3", _proto: _userproto002, debug: "Button3"};
  179. // View Button3 is declared to Adjusto2
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186. // Before Script for "Text1"
  187. // Copyright, © 1994 Apple Computer. All rights reserved.
  188.  
  189. Text1 := /* child of Adjusto2 */
  190.    {viewBounds: {left: 4, top: 8, right: 228, bottom: 28},
  191.     label: "Button 1 String:",
  192.     labelCommands:
  193.       ["OK", "Cancel", "Only Three Words", "Suggestive Action Title"],
  194.     text: "Button 1",
  195.     _proto: protoLabelInputLine,
  196.     debug: "Text1"
  197.    };
  198. // View Text1 is declared to Adjusto2
  199.  
  200.  
  201.  
  202. _view004 := /* child of Adjusto2 */
  203.    {viewBounds: {left: 6, top: 34, right: 86, bottom: 46},
  204.     text: "Update Text 1",
  205.     buttonClickScript:
  206.       func()
  207.       begin
  208.           SetValue(Button1, 'text, Text1.entryLine.text) ;
  209.       end,
  210.     _proto: _userproto001
  211.    };
  212.  
  213.  
  214.  
  215.  
  216. // Before Script for "Text2"
  217. // Copyright, © 1994 Apple Computer. All rights reserved.
  218.  
  219. Text2 := /* child of Adjusto2 */
  220.    {viewBounds: {left: 4, top: 52, right: 228, bottom: 72},
  221.     label: "Button 2 String:",
  222.     labelCommands:
  223.       ["OK", "Cancel", "Only Three Words", "Suggestive Action Title"],
  224.     text: "Button 2",
  225.     _proto: protoLabelInputLine,
  226.     debug: "Text2"
  227.    };
  228. // View Text2 is declared to Adjusto2
  229.  
  230.  
  231.  
  232. _view005 := /* child of Adjusto2 */
  233.    {viewBounds: {left: 6, top: 78, right: 86, bottom: 90},
  234.     text: "Update Text 2",
  235.     buttonClickScript:
  236.       func()
  237.       begin
  238.           SetValue(Button2, 'text, Text2.entryLine.text) ;
  239.       end,
  240.     _proto: _userproto001
  241.    };
  242.  
  243.  
  244.  
  245.  
  246. // Before Script for "Text3"
  247. // Copyright, © 1994 Apple Computer. All rights reserved.
  248.  
  249. Text3 := /* child of Adjusto2 */
  250.    {viewBounds: {left: 4, top: 96, right: 232, bottom: 116},
  251.     label: "Button 3 String:",
  252.     labelCommands:
  253.       ["OK", "Cancel", "Only Three Words", "Suggestive Action Title"],
  254.     text: "Button 3",
  255.     _proto: protoLabelInputLine,
  256.     debug: "Text3"
  257.    };
  258. // View Text3 is declared to Adjusto2
  259.  
  260.  
  261.  
  262. _view006 := /* child of Adjusto2 */
  263.    {viewBounds: {left: 6, top: 122, right: 86, bottom: 134},
  264.     text: "Update Text 3",
  265.     buttonClickScript:
  266.       func()
  267.       begin
  268.           SetValue(Button3, 'text, Text3.entryLine.text) ;
  269.       end,
  270.     _proto: _userproto001
  271.    };
  272.  
  273.  
  274.  
  275.  
  276.  
  277. _view007 := /* child of _view000 */
  278.    {text: "Adjusto Cluster",
  279.     viewBounds: {left: 13, top: 135, right: 104, bottom: 144},
  280.     viewFormat: 1,
  281.     viewJustify: 8388614,
  282.     _proto: protoStaticText
  283.    };
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291. // ---- Beginning of section for non used Layout files ----
  292.  
  293. // End of output